1. Field of the Invention
The present invention is directed to an improvement in computing systems and in particular to an improved system for the generation of runtime execution traces of applications and for problem determination for such applications.
2. Description of the Related Art
The complexity of current software products creates difficulties for end users, and software developers, in performing problem determination when a failure occurs in a software product. Not only is the cause of a failure potentially difficult to determine at the component level, problem determination may be sometimes difficult at the product level, when multiple software products are used at the time of the failure.
Software developers and users rely on known techniques for carrying out problem determination for computer applications. Typically, a given software component or product will be designed to generate an execution trace at runtime (sometimes referred to as xe2x80x9cproduct instrumentationxe2x80x9d). An execution trace is typically used by the component developer during the development cycle and by the end user during product usage. The trace of an application is potentially valuable in component debugging and fine-tuning, performance analysis, and for first failure data capture needed at a runtime crash. Execution traces for an object-oriented product may typically include information such as class name, method name, method entry/exit events, entry/exit parameter values for methods, thread identifiers, and hostname information. The type of information to be captured in a trace is usually left up to the product developer, but such information should be detailed enough to help in problem determination and source identification should unexpected behaviour, or a crash, occur.
While it is possible to generate runtime traces by inserting trace code in an application to be traced, it is also desirable to automate the instrumentation process so that no code need be inserted in the application source code itself.
In applications designed using Sun Microsystems Inc.""s Java(trademark) language, the problem of automating instrumentation has typically been addressed in two ways. The first is by instrumenting a specific Java virtual machine (VM) at a specific JDK (Java Developer Kit) level, and the second is by post-processing compiled Java byte code.
The first approach is used where a given Java VM includes a trace switch that can be used to enable/disable tracing at runtime. When a Java application is run on such a VM the VM will generate a runtime trace as specified by that VM""s trace functionality. Although the approach does provide Java applications with the capability of producing trace files, this type of instrumentation is VM specific. It is necessary to run the application using the specific instrumented VM to be able to generate the execution trace.
Such an approach is not well suited to distributed applications. Such applications running on different VMs cannot be traced consistently unless the VMs are similarly instrumented. Where the instrumentation of the different VMs is not identical, consistency of the trace becomes an issue. If the different VMs are instrumented using different architectures, then there is a difficulty in merging the different traces together.
A second approach to automating instrumentation of Java applications is the post-processing of compiled Java byte code. This approach uses byte code manipulation libraries that enable the insertion and modification of byte code in a Java .class file so that the Java code generates an execution trace at runtime. This approach has the following two disadvantages. Firstly, modifying byte code potentially creates Java security problems. When a JAR file (Java archive file) is signed using JDK software tools, each file in the archive is given a digest entry in the archive""s manifest. The digest values are hashes or encoded representations of the contents of the files as they were at the time of signing, and they will change if the file itself changes. Verifying a signed JAR file means that the digests of each of its files is to be re-computed and then compared with the digests recorded in the manifest to ensure that the contents of the JAR file haven""t changed since it was signed. Hence, byte code modification will result in difficulties where the application to be traced is in a signed JAR file. The application will not pass the security verification step as a result of the modification to the byte files made for tracing purposes.
In addition, modifying the byte code means that the resulting code can no longer be easily debugged. Debuggers expect a certain match between Java source files and their corresponding compiled .class files. When the byte code in a .class file is modified, there is no longer a match between the source code line numbers and the new .class files.
Thus, as may be seen from the above description, there are significant limitations inherent in the prior art approaches to generating a runtime trace for Java applications.
A further aspect of problem determination relates to the ability, given a runtime trace of an application, to perform problem analysis in order to determine the cause of a failure. It is desirable to have an approach to problem determination that may be effective across multiple products and thus be able to provide information to a developer or user where more than one product is involved at the time the software failure occurred.
Although various problem determination tools exist, they are usually limited to analysing a specific trace of a specific product, and are not capable of dealing with multiple products. Also, they are not usually designed to be implemented in a plugable architecture and there is therefore a limited ability to reuse the same analysis product for different application products.
It is therefore desirable to have a mechanism for generating VM-independent traces of Java applications without byte-code manipulation, the mechanism having a problem determination tool able to be used with different applications.
According to one aspect of the present invention, an improved system is provided for the generation of execution traces of applications and for problem determination for applications.
According to another aspect of the present invention, a computer system is provided for generating application execution trace data, the computer system including a monitor for launching one or more virtual machines, the monitor defining the functional characteristics of each of the virtual machines prior to the launch of each of the virtual machines, each of the virtual machines being enabled by the monitor to generate event data on the occurrence of specified events during application execution on each of the virtual machines, the monitor further including means to receive the event data from each of the virtual machines and including means to forward the event data to a logging services component, and the logging services component including means for receiving event data and for generating trace data for storage in a trace file.
According to another aspect of the present invention, there is provided the above computer system in which the virtual machines are Java language virtual machines and in which the monitor enables the virtual machines to generate event data using application program interfaces supplied by the Java Platform Debug Architecture.
According to another aspect of the present invention, the means to receive the event data of the above computer system comprises an event queue in the monitor to which each of the virtual machines is enabled to write the event data and from which the monitor may read the event data.
According to another aspect of the present invention, monitor of the above computer system further comprises an interface to permit a user to selectively launch one or more of the virtual machines using a Java connector object.
According to another aspect of the present invention, the monitor further comprises a filter for defining a subset of the event data, the event data forwarded to the logging services component being restricted to the defined subset.
According to another aspect of the present invention, a computer program product is provided which includes a computer usable medium having computer readable program code means embodied in the medium for generating application execution trace data. The computer program product includes computer readable program code means for causing a computer to define the functional characteristics of a virtual machine whereby the virtual machine is enabled to generate event data on the occurrence of specified events during application execution on the virtual machine, and to send the event data to an event queue; computer readable program code means for causing the computer to launch the virtual machine and to execute one or more applications on the virtual machine; computer readable program code means for causing the computer to execute a logging service for storing trace data in a trace file; and computer readable program code means for causing the computer to retrieve the event data from the event queue and to forward the event data to the logging service for storage in the trace file.
Preferably, the virtual machine is a Java language virtual machine and in which the functional characteristics are defined to generate event data on the occurrence of specified events during application execution by the use of application program interfaces supplied by the Java Platform Debug Architecture.
The present invention also provides a method for generating application execution trace data, the method including the steps of defining the functional characteristics of a virtual machine whereby the virtual machine is enabled to generate event data on the occurrence of specified events during application execution on the virtual machine, and to send the event data to an event queue; launching the virtual machine and executing one or more applications on the virtual machine; initializing and running a logging service for storing trace data in a trace file; and retrieving the event data from the event queue and forwarding the event data to the logging service for storage in the trace file.
The present invention further provides a method for generating a Java application execution trace data, the method including the steps of defining a Java virtual machine using a monitor, whereby the monitor defines the virtual machine using the Java Platform Debug Architecture to enable the virtual machine to generate event data on the occurrence of specified events during application execution on the virtual machine, and to send the event data to an event queue, the monitor registering events with an event request manager; launching the virtual machine and executing one or more Java applications on the virtual machine; initializing and running a logging service for storing trace data in a trace file; and until event data specifying the termination of the virtual machine is retrieved, the monitor retrieving the event data from the event queue and forwarding the event data to the logging service for storage in the trace file.
The present invention also provides a Java language package for generating application execution trace data, the package including a monitor for launching one or more Java virtual machines, the monitor to define the functional characteristics of each of the Java virtual machines prior to the launch of each of the Java virtual machines, each of the Java virtual machines being enabled by the monitor, using the Java Platform Debug Architecture, to generate event data on the occurrence of specified events during application execution on each of the Java virtual machines, and to forward the event data to an event queue, and a logging services component for receiving the event data from the event queue and for generating trace data for storage in a trace file.
The monitor of the above Java package may comprise the event queue and the monitor retrieves the event data from the event queue and forwards the event data to the logging services component. Further, the monitor may comprise the event queue and a filter for defining a subset of the event data, the monitor retrieving the event data from the event queue and forwarding the subset of the event data to the logging services component. Also, the monitor may further comprise an interface to permit a user to selectively launch one or more of the virtual machines using Java connector objects.
The present invention may also provide a computer system for analyzing trace file data, the computer system including a problem determination tools component for reading one or more product descriptions and for reading the trace file data, each product description including rules, the problem determination tools component including an execution component for selectively executing the rules based on information contained in the trace file data, the problem determination tools component including a reporting component for generating and displaying data for a user based on the execution of the rules by the problem determination tools component. The computer system may further include means for a user to select between pre-defined sets of rules based on a level of analysis of the trace file required by the user. Further, the level of analysis may be selected from a group comprising a product level, a component level, a code level and a logical level.
Additionally, a computer system is provided for generating and analyzing application execution trace data, the computer system including a monitor for launching one or more virtual machines, the monitor defining the functional characteristics of each of the virtual machines prior to the launch of each of the virtual machines, each of the virtual machines being enabled by the monitor to generate event data on the occurrence of specified events during application execution on each of the virtual machines, the monitor further including means to receive the event data from each of the virtual machines and including means to forward the event data to a logging services component, the logging services component including means for receiving event data and for generating trace data for storage in a trace file, a problem determination tools component for reading one or more product descriptions and for reading the trace file data, each product description including rules, the problem determination tools component including an execution component for selectively executing the rules based on information contained in the trace file data, and the problem determination tools component including a reporting component for generating and displaying data for a user based on the execution of the rules by the problem determination tools component.
Advantages of the present invention include a computer system in which a trace of an application may be obtained without requiring additional instrumentation code being added to the source code of the application or to the byte code for the application. A further advantage is that the components of the system are reusable. The problem determination for the applications is able to provide specific information about unexpected or undesirable application execution based on pre-defined and modifiable product descriptions.